import { getDicts } from "@/api/system/dict/data";
/**
 * 油品，根据油品名查类型
 */
export async function queryOilType(oilName) {
  const oilListRes = await getDicts("oil_name");
  let oilList;
  if (oilListRes.data) {
    oilList = oilListRes.data;
  } else {
    oilList = [];
  }
  const res = oilList.find((ele) => {
    return ele.dictLabel === oilName;
  });
  if (!res) {
    return 0;
  }
  return +res.dictValue;
}
